package com.glsc.ngateway.common.base.repo.sqlserver.glsec;

import com.glsc.ngateway.common.base.domain.sqlserver.glsec.TAmEhrEmpEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Auther: gaojc
 * @Date: 2021/9/22 18:40
 * @Description:
 */
@Repository
public interface TAmEhrEmpRepo extends JpaRepository<TAmEhrEmpEntity, String> {

    List<TAmEhrEmpEntity> findByDepid(@Param("depid") Integer depid);

    List<TAmEhrEmpEntity> findByDepidAndJobId(Integer depid, Integer jobId);

    @Query(value = "select * from eVW_EmpInfo WITH(NOLOCK)", nativeQuery = true)
    List<TAmEhrEmpEntity> getEVMEmpInfoList();

    List<TAmEhrEmpEntity> findUserListByReportto(@Param("reportto")String reportto);

    List<TAmEhrEmpEntity> findUserListByReporttoIn(@Param("reportto")List<String> reportto);

    List<TAmEhrEmpEntity> findUserListByBadgeIn(@Param("badge") List<String> userAccounts);

    List<TAmEhrEmpEntity> findUserListByDepidIn(@Param("depid") List<Integer> depts);

    List<TAmEhrEmpEntity> findUserListByTitleIn(@Param("title") List<String> depts);
}
